<template>
  <div id="applicationDetails" class="person-detail">
    <div>
      <van-nav-bar title="申请详情" :fixed="true" left-arrow @click-left="back" />
    </div>
    <div>
      <van-cell-group>
        <van-field label="用户名" disabled v-model="user" />
        <van-field label="申请人" disabled v-model="info.applyUser" />
        <van-field label="联系电话" disabled v-model="info.contactPhone" />
        <van-field label="申请原由" v-model="info.reason" disabled autosize />
        <van-field label="申请状态" disabled>
          <template slot="input">
            <div v-if="info.applyStatus == 1">
              <p>
                待审核
              </p>
              <p>
                {{info.approvalReason}}
              </p>
            </div>
            <div v-if="info.applyStatus == 2">
              <p>
                通过
              </p>
              <p>
                {{info.approvalReason}}
              </p>
            </div>
            <div v-if="info.applyStatus == 3">
              <p>
                驳回
              </p>
              <p>
                {{info.approvalReason}}
              </p>
            </div>

          </template>
        </van-field>
      </van-cell-group>
    </div>
  </div>
</template>
<script>
  import mine from "@/controller/mine.js"

  export default {
    name: 'applicationDetails',
    components: {},
    data() {
      return {
        info: '',
        user: JSON.parse(localStorage['specialService']) ? JSON.parse(localStorage['specialService']).app_name : ''
      }
    },
    computed: {},
    created() {},
    mounted() {
      this.getInfo()
    },
    methods: {
      getInfo() {
        let id = this.$route.query.id
        mine.spServiceApply_v1_get(id).then(res => {
          if (res.code == '0') {
            this.info = res.datas.applyTEntity
          } else {
            this.$toast(res.msg)
          }
        })
      },
      back() {
        this.$router.go(-1)
      },
    }
  }
</script>
<style lang="scss" scoped>
  #applicationDetails {
    background: #fff;

  }
</style>